package TagsDB;

import org.hibernate.Session;
/***
 * The class save \ update \ delete tuples from\to the plugin table in database
 * @author Guy
 *
 */
public class PluginManager 
{
	//Members
	private Session session = null;
	//Methods
	/**
	 * Contractor of PluginManager
	 * @param session
	 */
	public PluginManager(Session session) 
	{
		if(session == null)
			throw new
			RuntimeException("Invalid session object.");
		this.session = session;
	}
	/**
	 * Save new tuple of plugin
	 * @param plugin
	 */
	public void savePlugin(Plugin plugin)
	{
		session.save(plugin);
	}
	/**
	 * update an exist tuple of plugin
	 * @param plugin
	 */
	public void updatePlugin(Plugin plugin)
	{
		session.update(plugin);
	}
	/**
	 * delete an exist tuple of plugin
	 * @param plugin
	 */
	public void deletePlugin(Plugin plugin) 
	{
		session.delete(plugin);
	}
}
